home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / amos / amoslist-1294.lzh / AMOSLIST / text0096.txt < prev    next >
Encoding:
Text File  |  1995-01-03  |  1.7 KB  |  58 lines

  1.  
  2. Hi everybody!
  3.  
  4. Thanks to the replies to my original posting.
  5. Some people missunderstood me: I am not writing
  6. a new extension or something, I'm just
  7. translating a time consuming routine into
  8. assembler code. As the AMOS routine contained
  9. a Plot command, I wanted to use the equivalent
  10. command from the Gfx library which needs the
  11. RastPort of the screen.
  12.  
  13. Well, it may be true that AMOS does not use
  14. Intuition screens, but they have a RastPort.
  15. I know because I found out myself last night.
  16.  
  17. Register a5 seems to be pointing permanently
  18. to an internal AMOS structure. The RastPort
  19. of the actual screen is in Leek(Areg(5)-6346)
  20. and the GfxBase is in Leek(Areg(5)-6318).
  21.  
  22. I have tried it out with this simple
  23. assembler program (I hope it's correct because
  24. I haven't got it here right now):
  25.  
  26. move.l (a3)+,d1  ; Get y coord
  27. move.l (a3)+,d0  ; Get x coord
  28. move.l -6346(a5),a1 ; Get RastPort
  29. move.l -6318(a5),a6  ; Get GfxBase
  30. jsr WritePixel(a6) ; Call WritePixel of graphics.library
  31. rts
  32.  
  33. Once assembled this program can be loaded
  34. in a bank and called with
  35.  
  36. Call 15,x,y
  37.  
  38. It plots a point on the actual screen at (x,y).
  39.  
  40. Note that:
  41. - The graphics.library seems to be permanently open in AMOS
  42.   (No need to open it)
  43. - The parameters x and y are put on a "stack" to which a3
  44.   points at when you use the Call command. (See AMOS manual)
  45. - This program corresponds more or less to the "F Plot"
  46.   command of the Turbo extension. It's quite a lot faster
  47.   than the original AMOS Plot command. (I'm not sure if
  48.   it is faster when used this way, though, as the AMOS
  49.   "Call" command may need a lot of overhead (saving
  50.   the actual registers and other stuff?). I haven't looked
  51.   at it.
  52.  
  53.  
  54. Greetings,
  55.  
  56.     Chris
  57.  
  58.